﻿<UserControl x:Class="Starehe.Views.StaffDetails"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
              d:DesignHeight="722" d:DesignWidth="1024"
             mc:Ignorable="d"
	 Background="White">
    <UserControl.Resources>
        <SolidColorBrush x:Key="TitleBackgroundBrush" Color="{DynamicResource Title2BackgroundColor}"/>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <!-- Back button and page title -->
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Border Grid.ColumnSpan="2" Background="{DynamicResource TitleBackgroundBrush}"/>
            <Button x:Name="backButton" Margin="39,40,21,0" 
                        Style="{StaticResource BackButtonX}"
                        VerticalAlignment="Top"
                        AutomationProperties.Name="Back"
                        AutomationProperties.AutomationId="BackButton"
                        AutomationProperties.ItemType="Navigation Button"/>
            <TextBlock x:Name="pageTitle" Text="Staff Details" Style="{StaticResource HeaderTextStyle}" Grid.Column="1" HorizontalAlignment="Left"
                        IsHitTestVisible="false" VerticalAlignment="Bottom" Margin="0,0,30,40"/>

        </Grid>

        <TextBlock HorizontalAlignment="Left" Margin="40,50,0,0" Grid.Row="1" VerticalAlignment="Top"
                    Text="Staff ID" Style="{DynamicResource ContentTextSemiBold}"/>
        <TextBlock HorizontalAlignment="Left" Margin="40,90,0,0" Grid.Row="1" VerticalAlignment="Top"
                    Text="Name" Style="{DynamicResource ContentTextSemiBold}"/>
        <TextBlock HorizontalAlignment="Left" Margin="40,130,0,0" Grid.Row="1" VerticalAlignment="Top"
                    Text="National ID" Style="{DynamicResource ContentTextSemiBold}"/>
        <TextBlock HorizontalAlignment="Left" Margin="40,170,0,0" Grid.Row="1" VerticalAlignment="Top"
                    Text="Start Date" Style="{DynamicResource ContentTextSemiBold}"/>
        <TextBlock HorizontalAlignment="Left" Margin="40,210,0,0" Grid.Row="1" VerticalAlignment="Top"
                    Text="Phone No." Style="{DynamicResource ContentTextSemiBold}"/>
        <TextBlock HorizontalAlignment="Left" Margin="40,250,0,0" Grid.Row="1" VerticalAlignment="Top"
                    Text="Email" Style="{DynamicResource ContentTextSemiBold}"/>
        <TextBlock HorizontalAlignment="Left" Margin="40,290,0,0" Grid.Row="1" VerticalAlignment="Top"
                    Text="Address No." Style="{DynamicResource ContentTextSemiBold}"/>
        <TextBlock HorizontalAlignment="Left" Margin="40,330,0,0" Grid.Row="1" VerticalAlignment="Top"
                    Text="City" Style="{DynamicResource ContentTextSemiBold}"/>
        <TextBlock HorizontalAlignment="Left" Margin="40,370,0,0" Grid.Row="1" VerticalAlignment="Top"
                    Text="Postal Code" Style="{DynamicResource ContentTextSemiBold}"/>
        <TextBox HorizontalAlignment="Left" Margin="172,49,0,0" Grid.Row="1" VerticalAlignment="Top"
                   Text="{Binding CurrentStaff.StaffID}"
                 BorderThickness="0" Width="100" IsReadOnly="True"/>
        <TextBox HorizontalAlignment="Left" Margin="172,89,0,0" Grid.Row="1" VerticalAlignment="Top"
                   Text="{Binding CurrentStaff.Name}"
                 BorderThickness="0" Width="300" IsReadOnly="{Binding IsReadonly}"/>
        <TextBox HorizontalAlignment="Left" Margin="172,129,0,0" Grid.Row="1" VerticalAlignment="Top"
                   Text="{Binding CurrentStaff.NationalID, StringFormat={}{0:dd MMM yyyy}}"
                 BorderThickness="0" Width="250" IsReadOnly="{Binding IsReadonly}"/>
        <TextBox HorizontalAlignment="Left" Margin="172,169,0,0" Grid.Row="1"  VerticalAlignment="Top"
                   Text="{Binding CurrentStaff.DateOfAdmission, StringFormat={}{0:dd MMM yyyy}}"
                 BorderThickness="0" Width="250" IsReadOnly="{Binding IsReadonly}"/>
        <TextBox HorizontalAlignment="Left" Margin="172,215,0,0" Grid.Row="1" VerticalAlignment="Top"
                   Text="{Binding CurrentStaff.PhoneNo}"
                 BorderThickness="0" Width="250" IsReadOnly="{Binding IsReadonly}"/>
        <TextBox HorizontalAlignment="Left" Margin="172,255,0,0" Grid.Row="1" VerticalAlignment="Top"
                   Text="{Binding CurrentStaff.Email}"
                 BorderThickness="0" Width="250" IsReadOnly="{Binding IsReadonly}"/>
        <TextBox HorizontalAlignment="Left" Margin="172,295,0,0" Grid.Row="1" VerticalAlignment="Top"
                   Text="{Binding CurrentStaff.Address}"
                 BorderThickness="0" Width="250" IsReadOnly="{Binding IsReadonly}"/>
        <TextBox HorizontalAlignment="Left" Margin="172,335,0,0" Grid.Row="1" VerticalAlignment="Top"
                   Text="{Binding CurrentStaff.City}"
                 BorderThickness="0" Width="250" IsReadOnly="{Binding IsReadonly}"/>
        <TextBox HorizontalAlignment="Left" Margin="172,375,0,0" Grid.Row="1" VerticalAlignment="Top"
                   Text="{Binding CurrentStaff.PostalCode}"
                 BorderThickness="0" Width="250" IsReadOnly="{Binding IsReadonly}"/>
        <Border  BorderBrush="Silver" BorderThickness="2" Margin="450,130,20,0" Grid.Row="1" Height="394" VerticalAlignment="Top">
            <Image Source="{Binding CurrentStaff.SPhoto,Converter={StaticResource StreamToImageSourceConverter}}"/>
        </Border>
        <TextBlock HorizontalAlignment="Right" Margin="0,24,47,0" Grid.Row="1" VerticalAlignment="Top" IsHitTestVisible="False">
            <Hyperlink Command="{Binding ModifyStaffCommand}">Modify</Hyperlink>
        </TextBlock>
    </Grid>
</UserControl>
